#include <cstdio>

using namespace std;

typedef long long ll;
const int maxn=2000000, mods=998244353;
ll s[maxn+1], fact[2*maxn+1], invf[2*maxn+1], f[maxn+1], g[maxn+1];

ll qpower(ll a, int n) {
    ll s=1;
    for (; n; n/=2) {
        if (n&1) s=s*a%mods;
        a=a*a%mods;
    }
    return s;
}

void initFact(int n) {
    fact[0] = 1;
    for (int i=1; i<=n; i++) fact[i] = fact[i-1]*i%mods;
    invf[n] = qpower(fact[n], mods-2);
    for (int i=n; i; i--) invf[i-1] = invf[i]*i%mods;
}

ll inv(int x) {return invf[x]*fact[x-1]%mods;}

int main() {
    freopen("history.in", "r", stdin);
    freopen("history.out", "w", stdout);

    int n;
    scanf("%d", &n);
    initFact(2*n);
    for (int i=1; i<=n; i++) {
        int a;
        scanf("%d", &a);
        s[i] = (s[i-1]+a)%mods;
    }

    f[0]=inv(2), g[0]=inv(2)*inv(3)%mods;
    for (int i=1; i<=n; i++) {
        f[i] = (f[i-1]+inv(2*i+1)*inv(2*i+2)%mods)%mods;
        g[i] = (g[i-1]+inv(2*i+2)*inv(2*i+3)%mods)%mods;
    }

    ll ans=0;
    for (int r=2; r<n; r++) {
        int t=2*r+1-n;
        ll x = t<=2 ? f[r-2] : (t<=r ? f[r-t] : 0);
        ans = (ans+s[r]*x%mods)%mods;
    }
    for (int l=2; l<n; l++) {
        int t=(n+l-1)/2;
        ll x = t>=n ? f[n-l] : (t>=l ? f[t-l] : 0);
        ans = (ans+mods-s[l-1]*x%mods)%mods;
    }

    for (int r=1; r<=n/2; r++) ans = (ans+s[r]*inv(2*r-1)%mods)%mods;

    for (int r=2; r<=n-1; r++) {
        int t=(r+4)/2;
        ll x = t<=1 ? g[r-1] : (t<=r ? g[r-t] : 0);
        ans = (ans+s[r]*x%mods)%mods;
    }
    for (int l=2; l<=n-1; l++) {
        int t=2*l-3;
        ll x = t>=n ? g[n-1-l] : (t>=l ? g[t-l] : 0);
        ans = (ans+mods-s[l-1]*x%mods)%mods;
    }

    for (int l=(n+4)/2; l<=n; l++) {
        ans = (ans+(s[n]+mods-s[l-1])%mods*inv(2*n-2*l+2)%mods)%mods;
    }

    printf("%lld\n", ans);

    fclose(stdin);
    fclose(stdout);
    return 0;
}
